// https://umijs.org/config/
import { defineConfig } from 'umi'
import defaultSettings from './defaultSettings'
import proxy from './proxy'

const { REACT_APP_ENV } = process.env
export default defineConfig({
  hash: true,
  antd: {},
  dva: {
    hmr: true,
  },
  history: {
    type: 'hash',
  },
  locale: {
    // default zh-CN
    default: 'zh-CN',
    // default true, when it is true, will use `navigator.language` overwrite default
    antd: false,
    baseNavigator: false,
  },
  dynamicImport: {
    loading: '@/components/PageLoading/index',
  },
  targets: {
    ie: 11,
  },
  routes: [
    {
      path: '/user',
      component: '../layouts/UserLayout',
      routes: [
        {
          name: 'login',
          path: '/user/login',
          component: './user/login',
        },
      ],
    },
    {
      path: '/invitation',
      component: './Invitation',
    },
    {
      path: '/',
      component: '../layouts/SecurityLayout',
      routes: [
        {
          path: '/',
          component: '../layouts/BasicLayout',
          routes: [
            {
              path: '/',
              redirect: '/workplace',
            },
            {
              name: '工作台',
              path: '/workplace',
              component: './Workplace',
              authority: ['workplace'],
            },
            {
              name: '待办列表',
              path: '/workplace/message',
              hideInMenu: true,
              component: './Workplace/Message/List',
            },
            {
              name: '员工信息',
              path: '/info',
              component: './info/Index',
              hideInMenu: true,
              routes: [
                {
                  name: '人员详情',
                  path: '/info/details/:employeeId',
                  hideInMenu: true,
                  component: './Info/Details',
                },
                {
                  name: '人员编辑',
                  path: '/info/edit/:employeeId',
                  hideInMenu: true,
                  component: './Info/Edit',
                },
              ],
            },
            {
              name: '招聘管理',
              path: '/recruitment',
              component: './Recruitment/Index',
              authority: ['recruitment'],
              routes: [
                {
                  name: '招聘人员',
                  path: '/recruitment/employee',
                  component: './Recruitment/Employee/List',
                  authority: ['recruitment/employee'],
                },
                {
                  name: '员工录用',
                  path: '/recruitment/hire',
                  component: './Recruitment/Hire/List',
                  authority: ['recruitment/hire'],
                },
                {
                  name: 'Offer发送',
                  path: '/recruitment/offer',
                  component: './Recruitment/Offer/List',
                  authority: ['recruitment/offer'],
                },
                {
                  name: '邮件列表',
                  path: '/recruitment/email',
                  component: './Recruitment/Email/List',
                  authority: ['recruitment/email'],
                },
                {
                  name: '邮件发送',
                  path: '/recruitment/email/:employeeId',
                  hideInMenu: true,
                  component: './Recruitment/Email',
                },
              ],
            },
            {
              name: '人事事件',
              path: '/personnel',
              component: './Personnel/Index',
              authority: ['personnel'],
              routes: [
                {
                  name: '员工入职',
                  path: '/personnel/entry',
                  authority: ['personnel/entry'],
                  routes: [
                    {
                      name: '入职办理',
                      path: '/personnel/entry/newEmployees',
                      component: './Personnel/Entry/NewEmployees/List',
                    },
                  ]
                },
                {
                  name: '员工转正',
                  path: '/personnel/turnPositive',
                  authority: ['personnel/turnPositive'],
                  routes: [
                    {
                      name: '新员工试用期管理',
                      path: '/personnel/turnPositive/newProbationManagement',
                      component: './Personnel/TurnPositive/NewProbationManagement/List',
                    },
                    {
                      name: '新员工转正跟踪',
                      path: '/personnel/turnPositive/newProcessCheck',
                      component: './Personnel/TurnPositive/NewProcessCheck/List',
                    },
                    {
                      name: '干部考察期管理',
                      path: '/personnel/turnPositive/promotionProbationManagement',
                      component: './Personnel/TurnPositive/PromotionProbationManagement/List',
                    },
                    {
                      name: '干部转正跟踪',
                      path: '/personnel/turnPositive/promotionProcessCheck',
                      component: './Personnel/TurnPositive/PromotionProcessCheck/List',
                    },
                    // {
                    //   name: '培训信息填写',
                    //   path: '/personnel/turnPositive/training',
                    //   component: './Personnel/TurnPositive/Training/List',
                    // },
                    // {
                    //   name: '薪资信息填写',
                    //   path: '/personnel/turnPositive/salaryInfo',
                    //   component: './Personnel/TurnPositive/SalaryInfo/List',
                    // },
                  ]
                },
                {
                  name: '员工调动',
                  path: '/personnel/transfer',
                  authority: ['personnel/transfer'],
                  routes: [
                    {
                      name: '员工借调',
                      path: '/personnel/transfer/secondment',
                      authority: ['personnel/transfer/secondment'],
                      component: './Personnel/Transfer/Secondment',
                    },
                    {
                      name: '部门内部调动',
                      path: '/personnel/transfer/transfer',
                      authority: ['personnel/transfer/transfer'],
                      component: './Personnel/Transfer/List',
                    },
                    {
                      name: '单位内部部门之间调动',
                      path: '/personnel/transfer/internalMobility',
                      authority: ['personnel/transfer/internalMobility'],
                      component: './Personnel/Transfer/departmentTransferList',
                    },
                    {
                      name: '跨单位之间调动',
                      path: '/personnel/transfer/transferBetweenUnits',
                      authority: ['personnel/transfer/transferBetweenUnits'],
                      component: './Personnel/Transfer/unitTransferList',
                    },
                  ]
                },
                {
                  name: '员工晋级',
                  path: '/personnel/promotion',
                  authority: ['personnel/promotion'],
                  routes: [
                    {
                      name: '批量管理晋级',
                      path: '/personnel/promotion/management',
                      component: './Personnel/Promotion/Management/List',
                    },
                    {
                      name: '批量专业晋级',
                      path: '/personnel/promotion/profession',
                      component: './Personnel/Promotion/Profession/List',
                    },
                    {
                      name: '批量降级',
                      path: '/personnel/promotion/degrade',
                      component: './Personnel/Promotion/Degrade/List',
                    },
                    {
                      name: '管理晋级流程跟踪',
                      path: '/personnel/promotion/managementCheck',
                      component: './Personnel/Promotion/ManagementCheck',
                    },
                    {
                      name: '专业晋级流程跟踪',
                      path: '/personnel/promotion/professionCheck',
                      component: './Personnel/Promotion/ProfessionCheck',
                    },
                  ]
                },
                {
                  name: '离职管理',
                  path: '/personnel/resignation',
                  authority: ['personnel/resignation'],
                  routes: [
                    {
                      name: '离职申请',
                      path: '/personnel/resignation/list',
                      component: './Personnel/Resignation/List',
                    },
                    {
                      name: '离职结算',
                      path: '/personnel/resignation/settlement',
                      component: './Personnel/Resignation/Settlement',
                    },
                    {
                      name: '离职审计',
                      path: '/personnel/resignation/auditNotice',
                      authority: ['personnel/resignation/auditNotice'],
                      component: './Personnel/Resignation/AuditNotice',
                    },
                    {
                      name: '审计待办',
                      path: '/personnel/resignation/auditUpcoming',
                      authority: ['personnel/resignation/auditUpcoming'],
                      component: './Personnel/Resignation/AuditUpcoming',
                    },
                  ]
                },
              ],
            },
            {
              name: '绩效管理',
              path: '/performance',
              component: './performance/Index',
              authority: ['performance'],
              routes: [
                {
                  name: '个人绩效记录',
                  path: '/performance/personal/record',
                  authority: ['performance/personal/record'],
                  component: './Performance/Personal/Record',
                },
                {
                  name: '个人绩效管理',
                  path: '/performance/personal/manage',
                  authority: ['performance/personal/manage'],
                  component: './Performance/Personal/Manage',
                },
                {
                  name: '单位绩效记录',
                  path: '/performance/unit/record',
                  authority: ['performance/unit/record'],
                  component: './Performance/Unit/Record',
                },
                {
                  name: '单位绩效管理',
                  path: '/performance/unit/manage',
                  authority: ['performance/unit/manage'],
                  component: './Performance/Unit/Manage',
                },
                {
                  name: '绩效比例配置',
                  path: '/performance/config',
                  authority: ['performance/config'],
                  component: './Performance/Config',
                },
              ]
            },
            {
              name: '薪酬管理',
              path: '/salary',
              component: './Salary/Index',
              authority: ['salary'],
              routes: [
                {
                  name: '薪资组分配',
                  path: '/salary/allocation',
                  authority: ['salary/allocation'],
                  component: './Salary/Allocation/List',
                },
                {
                  name: '薪资组分配记录',
                  path: '/salary/allocationRecord',
                  authority: ['salary/allocationRecord'],
                  component: './Salary/AllocationRecord/List',
                },
                {
                  name: '薪酬带宽',
                  path: '/salary/band',
                  authority: ['salary/band'],
                  component: './Salary/Band/List',
                },
                {
                  name: '薪酬带宽监控',
                  path: '/salary/monitor',
                  authority: ['salary/monitor'],
                  component: './Salary/Monitor/List',
                },
                {
                  name: '奖罚包分配',
                  path: '/salary/awardPackage',
                  authority: ['salary/awardPackage'],
                  component: './Salary/AwardPackage/List',
                },
                {
                  name: '奖罚分配',
                  path: '/salary/award',
                  authority: ['salary/award'],
                  component: './Salary/Award/List',
                },
                {
                  name: '补贴申请',
                  path: '/salary/subsidy',
                  authority: ['salary/subsidy'],
                  routes: [
                    {
                      name: '电脑补贴',
                      path: '/salary/subsidy/computer',
                      component: './Salary/Subsidy/Computer',
                    },
                    {
                      name: '异地补贴',
                      path: '/salary/subsidy/offSite',
                      component: './Salary/Subsidy/OffSite',
                    },
                    {
                      name: '住房补贴',
                      path: '/salary/subsidy/housing',
                      component: './Salary/Subsidy/Housing',
                    },
                    {
                      name: '其他补贴',
                      path: '/salary/subsidy/other',
                      component: './Salary/Subsidy/Other',
                    }
                  ],
                },
                {
                  name: '工资卡',
                  path: '/salary/bankcard',
                  authority: ['salary/bankcard'],
                  component: './Salary/BankCard/List',
                },
                {
                  name: '薪资调整',
                  path: '/salary/adjustment',
                  authority: ['salary/adjustment'],
                  component: './Salary/Adjustment/List',
                },
                {
                  name: '薪资确认',
                  path: '/salary/confirm',
                  authority: ['salary/confirm'],
                  component: './Salary/Confirm/List',
                },

              ],
            },
            {
              name: '人员管理',
              path: '/archive',
              component: './archive/Index',
              authority: ['archive'],
              routes: [
                {
                  name: '人员名单',
                  path: '/archive/list',
                  authority: ['archive/List'],
                  component: './Archive/List',
                },
                {
                  name: '归档人员',
                  path: '/archive/staff',
                  authority: ['archive/staff'],
                  component: './Archive/Staff/List',
                },
                {
                  name: '人员导出',
                  path: '/archive/export',
                  authority: ['archive/export'],
                  routes: [
                    {
                      name: '入职信息导出',
                      path: '/archive/export/Entry',
                      component: './Archive/Export/EntryList/index',
                    }
                  ],
                },
                {
                  name: '账号开通',
                  path: '/archive/accountOpening',
                  authority: ['archive/accountOpening'],
                  component: './Archive/AccountOpening/List',
                },
              ],
            },
            {
              name: '测评管理',
              path: '/assessment',
              authority: ['assessment'],
              routes: [
                {
                  name: '360评分',
                  path: '/assessment/scoreOf360',
                  component: './ScoreOf360/Index',
                  authority: ['assessment/scoreOf360'],
                  routes: [
                    {
                      name: '评分列表',
                      path: '/assessment/scoreOf360/list',
                      authority: ['assessment/scoreOf360/list'],
                      component: './ScoreOf360/List',
                    },
                    {
                      name: '评分配置',
                      path: '/assessment/scoreOf360/scoreConfig',
                      authority: ['assessment/scoreOf360/scoreConfig'],
                      component: './ScoreOf360/ScoreConfig',
                    },
                  ],
                },
              ]
            },
            {
              name: '考勤管理',
              path: '/attendance',
              component: './Attendance/Index',
              authority: ['attendance'],
              routes: [
                {
                  name: '调班查询',
                  path: '/attendance/shiftQuery',
                  component: './Attendance/ShiftQuery/List',
                },
                {
                  name: '补卡查询',
                  path: '/attendance/supplement',
                  component: './Attendance/Supplement',
                },
                {
                  name: '销假查询',
                  path: '/attendance/endHoliday',
                  component: './Attendance/EndHoliday',
                },
                {
                  name: '排班查询',
                  path: '/attendance/scheduling',
                  component: './Attendance/Scheduling',
                },
                {
                  name: '加班申请列表',
                  path: '/attendance/overtime/apply',
                  component: './Attendance/OvertimeApply',
                },
                {
                  name: '零星加班申请',
                  path: '/attendance/overtimeSporadic',
                  component: './Attendance/OvertimeSporadic',
                },
                {
                  name: '零星调休查询',
                  path: '/attendance/sporadicBreaks',
                  component: './Attendance/SporadicBreaks',
                },
                {
                  name: '请假调休列表',
                  path: '/attendance/vacation',
                  component: './Attendance/Vacation/List',
                },
              ],
            },
            {
              name: '合同管理',
              path: '/contract',
              component: './contract/Index',
              authority: ['contract'],
              routes: [
                {
                  name: '新签合同',
                  path: '/contract/newSign',
                  component: './Contract/NewSign',
                },
                {
                  name: '续签合同',
                  path: '/contract/renew',
                  component: './Contract/Renew',
                },
                {
                  name: '解除合同',
                  path: '/contract/dismiss',
                  routes: [
                    {
                      name: '合同解除',
                      path: '/contract/dismiss/relieve',
                      component: './Contract/Dismiss/Relieve',
                    },
                    {
                      name: '终止解除',
                      path: '/contract/dismiss/terminationLift',
                      component: './Contract/Dismiss/TerminationLift',
                    },
                  ]
                },
                // {
                //   name: '合同列表',
                //   path: '/contract/manage',
                //   component: './Contract/Manage/List',
                // },
                {
                  name: '合同台账',
                  path: '/contract/ledger',
                  component: './Contract/Ledger',
                },
              ],
            },
            {
              name: '培训管理',
              path: '/trainingManagement',
              component: './TrainingManagement/Index',
              authority: ['trainingManagement'],
              routes: [
                {
                  name: '培训协议',
                  path: '/trainingManagement/trainingAgreement',
                  component: './TrainingManagement/TrainingAgreement/List',
                  authority: ['trainingManagement/trainingAgreement'],
                },
                {
                  name: '培训台账',
                  path: '/trainingManagement/trainingLedger',
                  component: './TrainingManagement/TrainingLedger/List',
                  authority: ['trainingManagement/trainingLedger'],
                },
              ],
            },
            {
              name: '证明管理',
              path: '/certify',
              component: './Certify/Index',
              authority: ['certify'],
              routes: [
                {
                  name: '证明审核',
                  path: '/certify/verify',
                  component: './Certify/Verify',
                },
              ],
            },
            {
              name: '资质管理',
              path: '/credential',
              component: './Credential/Index',
              authority: ['credential'],
              routes: [
                {
                  name: '资质审核',
                  path: '/credential/list',
                  authority: ['credential/list'],
                  component: './Credential/List',
                },
                {
                  name: '资质列表',
                  path: '/credential/ledger',
                  authority: ['credential/ledger'],
                  component: './Credential/Ledger',
                },
                {
                  name: '补贴发放列表',
                  path: '/credential/titularManage',
                  authority: ['credential/titularManage'],
                  component: './Credential/TitularManage',
                },
                {
                  name: '资质配置',
                  path: '/credential/titularConfig',
                  authority: ['credential/titularConfig'],
                  component: './Credential/TitularConfig',
                },
              ],
            },
            {
              name: '社保公积金管理',
              path: '/security',
              component: './Security/Index',
              authority: ['security'],
              routes: [
                {
                  name: '社保管理',
                  path: '/security/securityManage',
                  authority: ['security/securityManage'],
                  routes: [
                    {
                      name: '社保方案',
                      path: '/security/securityManage/securityPlanList',
                      authority: ['security/securityManage/securityPlanList'],
                      component: './Security/SocialSecurityPlan/List',
                    },
                    {
                      name: '变更记录',
                      path: '/security/securityManage/programChangesList',
                      authority: ['security/securityManage/programChangesList'],
                      component: './Security/SocialSecurityPlan/ProgramChangesList',
                    },
                    {
                      name: '社保台账',
                      path: '/security/securityManage/ledgerList',
                      authority: ['security/securityManage/ledgerList'],
                      component: './Security/SocialSecurityPlan/LedgerList',
                    },
                    {
                      name: '社保汇缴确认月报表',
                      path: '/security/securityManage/changesSummary',
                      authority: ['security/securityManage/changesSummary'],
                      component: './Security/SocialSecurityPlan/changesSummary',
                    },
                    {
                      name: '社保明细查询报表',
                      path: '/security/securityManage/report',
                      // authority: ['security/securityManage/report'],
                      component: './Security/SocialSecurityPlan/Report',
                    }
                  ]
                },
                {
                  name: '公积金管理',
                  path: '/security/commonAccManage',
                  authority: ['security/commonAccManage'],
                  routes: [
                    {
                      name: '公积金方案',
                      path: '/security/commonAccManage/securityPlanList',
                      authority: ['security/commonAccManage/securityPlanList'],
                      component: './Security/CommonAccumulationPlan/List',
                    },
                    {
                      name: '变更记录',
                      path: '/security/commonAccManage/programChangesList',
                      authority: ['security/commonAccManage/programChangesList'],
                      component: './Security/CommonAccumulationPlan/ProgramChangesList',
                    },
                    {
                      name: '公积金台账',
                      path: '/security/commonAccManage/ledgerList',
                      authority: ['security/commonAccManage/ledgerList'],
                      component: './Security/CommonAccumulationPlan/LedgerList',
                    },
                    {
                      name: '公积金汇缴确认月报表',
                      path: '/security/commonAccManage/changesSummary',
                      authority: ['security/commonAccManage/changesSummary'],
                      component: './Security/CommonAccumulationPlan/changesSummary',
                    },
                    {
                      name: '公积金明细查询报表',
                      path: '/security/commonAccManage/report',
                      // authority: ['security/commonAccManage/report'],
                      component: './Security/CommonAccumulationPlan/Report',
                    }
                  ]
                },
                {
                  name: '雇主责任险',
                  path: '/security/insuranceManage',
                  authority: ['security/insuranceManage'],
                  routes: [
                    {
                      name: '雇主责任险方案',
                      path: '/security/insuranceManage/LiabilityInsuranceList',
                      authority: ['security/insuranceManage/LiabilityInsuranceList'],
                      component: './Security/LiabilityInsurance/List',
                    },
                    {
                      name: '变更记录',
                      path: '/security/insuranceManage/programChangesList',
                      authority: ['security/insuranceManage/programChangesList'],
                      component: './Security/LiabilityInsurance/ProgramChangesList',
                    },
                    {
                      name: '雇主责任险台账',
                      path: '/security/insuranceManage/ledgerList',
                      authority: ['security/insuranceManage/ledgerList'],
                      component: './Security/LiabilityInsurance/LedgerList',
                    }
                  ]
                },

              ],
            },
            {
              name: '配置管理',
              path: '/config',
              component: './Config/Index',
              authority: ['config'],
              routes: [
                {
                  name: 'banner管理',
                  path: '/config/banner',
                  component: './Config/Banner/List',
                },
                {
                  name: '公告管理',
                  path: '/config/bulletin',
                  component: './Config/Bulletin/List',
                },
                {
                  name: '合同主体管理',
                  path: '/config/subject',
                  component: './Config/Subject/List',
                },
                {
                  name: '通用参数配置',
                  path: '/config/parameter',
                  component: './Config/Parameter/List',
                },
               {
                 name: 'BPM流程参数配置',
                 path: '/config/bpmProcess',
                 component: './Config/BpmProcess',
                },
              ],
            },
            {
              name: '系统设置',
              path: '/system',
              component: './System/Index',
              authority: ['system'],
              routes: [
                {
                  name: '用户管理',
                  path: '/system/roleAssignment',
                  component: './System/RoleAssignment/UserList',
                },
                {
                  name: '角色管理',
                  path: '/system/menuAssignment',
                  component: './System/RoleAssignment/RoleList',
                },
                {
                  name: '公司组管理',
                  path: '/system/groupAssignment',
                  component: './System/RoleAssignment/CompanyGroup',
                },
                {
                  name: '主体组管理',
                  path: '/system/mainBody',
                  component: './System/RoleAssignment/MainBody',
                },
                {
                  name: '菜单管理',
                  path: '/system/menuManagement',
                  component: './System/RoleAssignment/MenuList',
                },
                {
                  name: '功能管理',
                  path: '/system/funcManagement',
                  component: './System/RoleAssignment/FuncList',
                },
                {
                  name: '通知角色管理',
                  path: '/system/msgRoleManagement',
                  component: './System/RoleAssignment/MessageRoleList',
                },
                {
                  name: '用户操作管理',
                  path: '/system/behavior',
                  component: './System/Behavior/List',
                },
              ],
            },
            {
              component: './404',
            },
          ],
        },
        {
          component: './404',
        },
      ],
    },
    {
      component: './404',
    },
  ],
  theme: {
    'primary-color': defaultSettings.primaryColor,
  },
  title: false,
  ignoreMomentLocale: true,
  proxy: proxy[REACT_APP_ENV || 'dev'],
  manifest: {
    basePath: '/',
  },
  publicPath: './',
})
